<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="1.js"></script>
</head>

<body>
    <div id="seq"></div>
    <script type="text/html" id="tpl-user">
        <div>姓名：{{name}}</div>
        <div>年龄：{{ age }}</div>
        <div>性别：{{  gender}}</div>
        <div>住址：{{address  }}</div>
      </script>

    <script>
        var data = { name: '小七', age: '18', gender: '男', address: '星空' }
        var Htmlstr = template('tpl-user', data)
        document.getElementById('seq').innerHTML = Htmlstr;
    </script>
</body>

</html>